<?php
	session_start();
	include("load-settings.php");

	if(!isset($_SESSION['user']))
		die;
		//header("Location: login.php");

	$user = $_SESSION['user'];

	$result = mysql_query("SELECT * FROM user WHERE id = $user");
	$row = mysql_fetch_array($result);
	$access = $row['type'];

	$order = mysql_real_escape_string($_POST['order']);

	$message = mysql_real_escape_string($_POST['msg-box']);
	
	mysql_query("INSERT INTO leveling_chat (user, message, timestamp, leveling_order) VALUES ($user, '$message', ".time().", $order)") or die (mysql_error());

	//header("Location: leveling_order.php?id=".$order);
?>